import { useState, useEffect  } from 'react';
import DogImages from './DogImages';


export default function DogImagesContainer() {
  const [dogImages, setDogImages] = useState<string[]>([]);

  useEffect(() => {
    fetch('https://dog.ceo/api/breed/labrador/images/random/6')
    .then(res => res.json())
    .then(({ message }) => {
      setDogImages(message)
    })
  }, [])

  return (
    <DogImages dogImages={dogImages} />
  )
}